<?php
class loginController extends Controller{
	public function index(){
	   $user=load_service('i_user_login');
       if($user->user_session('ISLOGIN')){
            alert('您已经登陆！');
            jump('shell','index');
       }
	   $this->_login();
	}
	public function _login(){
		include($this->viewer_dir.'login/_login.php');
	}
	public function login_(){
		$user=load_service('i_user_login');
		$r=$user->user_login($_POST);
		switch($r){
			case 1:
			jump('shell','index');
			break;
			case -1:
			alert('信息未填写完全!');
            back();
			break;
			case -2:
			alert('验证码不正确！');
            back();
			break;
			case -3:
			alert('用户不存在！');
            back();
			break;
			case -4:
			alert('密码不正确');
            back();
			break;
		}
	}
    public function logout(){
        echo '正在退出，请稍候...';
        $user=load_service('i_user_login');
        $user->user_logout();
        jump('login','index');
    }
}
